package com.mazaiting.auth.constant;

/**
 * 安全常量
 *
 * @author mazaiting
 * @create_time 2022/8/21 10:40
 */
public class SecurityConst {

    /**
     * 认证请求头key
     */
    public static final String KEY_AUTHORIZATION = "Authorization";
    public static final String KEY_AUTHORIZATION_NEW = "authorization";

    /**
     * JWT令牌前缀
     */
    public static final String JWT_PREFIX = "Bearer ";

    /**
     * Basic认证前缀
     */
    public static final String BASIC_PREFIX = "Basic ";

    /**
     * JWT载体key
     */
    public static final String KEY_JWT_PAYLOAD = "payload";

    /**
     * JWT ID 唯一标识
     */
    public static final String KEY_JWT_JTI = "jti";

    /**
     * 黑名单token前缀
     */
    public static final String TOKEN_BLACKLIST_PREFIX = "auth:token:blacklist:";

    /**
     * 用户 ID
     */
    public static final String KEY_USER_ID = "user_id";

    /**
     * 客户端 ID 键
     */
    public static final String KEY_CLIENT_ID = "client_id";
    public static final String KEY_CLIENT_ID_NEW = "clientId";

    /**
     * JWT存储权限前缀
     */
    public static final String AUTHORITY_PREFIX = "ROLE_";

    /**
     * JWT存储权限属性
     */
    public static final String KEY_JWT_AUTHORITIES = "authorities";

    /**
     * 刷新令牌键
     */
    public static final String KEY_REFRESH_TOKEN = "refresh_token";
    public static final String KEY_REFRESH_TOKEN_NEW = "refreshToken";

    /**
     * 认证身份标识
     */
    public static final String KEY_AUTHENTICATION_IDENTITY = "authenticationIdentity";

    /**
     * 刷新类型标识
     */
    public static final String KEY_REFRESH_TYPE = "refresh_type";

    /**
     * 验证码key前缀
     */
    public static final String VALIDATION_CODE_KEY_PREFIX = "captcha:";

    /**
     * 短信验证码key前缀
     */
    public static final String SMS_CODE_PREFIX = "sms_code:";

    /**
     * 测试客户端ID
     */
    public static final String TEST_CLIENT_ID = "client";


    public static final String TOKEN_PREFIX = "auth:token:";

    /**
     * 过期键
     */
    public static final String KEY_EXP = "exp";
    /**
     * 管理员
     */
    public static final String ROLE_ROOT_CODE = "ROOT";

    /**
     * 授权客户端 KEY
     */
    public static final String KEY_OAUTH_CLIENT = "oauth_client";
    /**
     * 部门 ID KEY
     */
    public static final String KEY_DEPT_ID = "dept_id";

    /**
     * 用户名
     */
    public static final String KEY_USER_NAME = "username";
    /**
     * 密码
     */
    public static final String KEY_PASSWORD = "password";
    /**
     * 授权类型
     */
    public static final String KEY_GRANT_TYPE = "grant_type";
    /**
     * UUID 唯一标识符
     */
    public static final String KEY_UUID = "uuid";
    /**
     * 验证码
     */
    public static final String KEY_CODE = "code";
    /**
     * 手机号
     */
    public static final String KEY_MOBILE = "mobile";
    /**
     * 加密数据
     */
    public static final String KEY_ENCRYPTED_DATA = "encryptedData";
    /**
     * IV key
     */
    public static final String KEY_IV = "iv";
}
